<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>
  Hantsy
  
  Bai
  
  
  | Deploying Jakarta EE 9 applications to Open Liberty
  
</title>
<meta name="description" content="My personal website focusing on Java EE/Jakarta EE and Spring.
">

<!-- Open Graph -->


<!-- Bootstrap & MDB -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
  rel="stylesheet" integrity="sha512-MoRNloxbStBcD8z3M/2BmnT+rg4IsMxPkXaGh2zD6LGNNFE80W3onsAhRcMAMrSoyWL9xD7Ert0men7vR8LUZg==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css"
  integrity="sha512-RO38pBRxYH3SoOprtPTD86JFOclM51/XTIdEPh5j8sj4tp8jmQIx26twG52UaLi//hQldfrh7e51WzP9wuP32Q==" crossorigin="anonymous" />

<!-- Fonts & Icons -->
<link rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
  integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous">
<link rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.0/css/academicons.min.css"
  integrity="sha512-W4yqoT1+8NLkinBLBZko+dFB2ZbHsYLDdr50VElllRcNt2Q4/GSs6u71UHKxB7S6JEMCp5Ve4xjh3eGQl/HRvg==" crossorigin="anonymous">
<link rel="stylesheet" type="text/css"
  href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:100,300,400,500,700|Material+Icons">

<!-- Code Syntax Highlighting -->
<link rel="stylesheet"
  href="https://gitcdn.link/repo/jwarby/jekyll-pygments-themes/master/github.css" />

<!-- Styles -->
<link rel="shortcut icon" href="/assets/img/favicon.ico">
<link rel="stylesheet" href="/assets/css/main.css">

<link rel="canonical" href="/blog/2020/deploying-jakarta-ee-9-applications-to-open-liberty/">

<!-- JQuery -->
<!-- jQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>


<!-- Theming-->

<script src="/assets/js/theme.js"></script>
<!-- Load DarkMode JS -->
<script src="/assets/js/dark_mode.js"></script>



<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-18SZ2W3GXD"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { dataLayer.push(arguments); }
  gtag('js', new Date());

  gtag('config', 'G-18SZ2W3GXD');
</script>




  
<!-- MathJax -->
<script type="text/javascript">
  window.MathJax = {
    tex: {
      tags: 'ams'
    }
  };
</script>
<script defer type="text/javascript" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/tex-mml-chtml.js"></script>
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>


  <link type="application/atom+xml" rel="alternate" href="/feed.xml" title="blank" />
  <!-- Begin Jekyll SEO tag v2.7.1 -->
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Deploying Jakarta EE 9 applications to Open Liberty" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Open Liberty has provided a standalone preview distribution for Jakarta EE 9 in the past development iterations. At the moment I wrote this post, the latest version is 21.0.0.1-beta. Open Liberty follows a monthly publication cycle, I think the stale version will be provided in the next months. Go to the Download page and switch to Beta tab, there are two package options in the table. Jakarta EE 9 Beta FeaturesAll Beta Features And make sure you are downloading the Jakarta EE 9 Beta Features. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6Open Liberty 21.0.0.1-beta Deploying to Open Liberty manually Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Enter the Open Liberty folder, start up the Open Liberty server. # cd wlp\bin # server start // `server run` to show logs in the fontend consoleStarting server defaultServer.CWWKE0953W: This version of Open Liberty is an unsupported early release version.Server defaultServer started. If you are the first time to run server, it will create a server profile for you. It will create a new folder named defaultServer in the usr/servers folder to prepare all resources of a jakartaee-9.0 feature pack, check the usr/servers/defaultServer/server.xml file for details . NOTE: The server profile is similar to the domain concept in other application servers, such as Glassfish, WildFly, etc. To deploy our application, just copy the war to the wlp/usr/servers/defaultServer/dropins folder. In the usr/servers/defaultServer/logs/messages.log file, you will see the deployment progress. [11/24/20, 16:00:07:304 CST] 00000046 com.ibm.ws.app.manager.AppMessageHelper I CWWKZ0018I: Starting application jakartaee9-starter-boilerplate.[11/24/20, 16:00:07:304 CST] 00000046 bm.ws.app.manager.war.internal.WARDeployedAppInfoFactoryImpl I CWWKZ0133I: The jakartaee9-starter-boilerplate application at the D:\appsvr\wlp\usr\servers\defaultServer\dropins\jakartaee9-starter-boilerplate.war location is being expanded to the D:\appsvr\wlp\usr\servers\defaultServer\apps\expanded\jakartaee9-starter-boilerplate.war directory.[11/24/20, 16:00:09:629 CST] 00000046 org.jboss.weld.Version I WELD-000900: 4.0.0 (Alpha3)[11/24/20, 16:00:10:709 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.config.annotation.CdiAnnotationProviderExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:10:726 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.cdi.JsfArtifactProducerExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:11:770 CST] 00000046 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: jakartaee9-starter-boilerplate.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.webcontainer I SRVE0250I: Web Module jakartaee9-starter-boilerplate has been bound to default_host.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/jakartaee9-starter-boilerplate[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.[11/24/20, 16:00:11:864 CST] 00000046 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.[11/24/20, 16:00:11:896 CST] 0000004e org.apache.myfaces.ee.MyFacesContainerInitializer I Using org.apache.myfaces.ee.MyFacesContainerInitializer[11/24/20, 16:00:12:005 CST] 0000004e com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.701 seconds.[11/24/20, 16:00:12:370 CST] 0000004e org.jboss.resteasy.resteasy_jaxrs.i18n I RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy[11/24/20, 16:00:12:433 CST] 0000004e com.ibm.ws.webcontainer.servlet I SRVE0242I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Initialization successful. To undeploy the application, just remove the war file from the wlp/usr/servers/defaultServer/dropins folder. Check the usr/servers/defaultServer/logs/messages.log file, you will see the log like this. [11/24/20, 16:04:13:245 CST] 00000066 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:04:13:248 CST] 00000066 com.ibm.ws.webcontainer.servlet I SRVE0253I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Destroy successful.[11/24/20, 16:04:13:281 CST] 00000066 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[11/24/20, 16:04:13:359 CST] 00000027 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml. Using Liberty Maven Plugin Declare a liberty-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt;&lt;/plugin&gt; When simply running liberty:run , it will retrieve the latest io.openliberty:openliberty-kernel and install required features defined in your project specific src/main/liberty/config/server.xml file, then start the server and deploy your application to this server. To use the latest Open Liberty Jakarta EE 9 beta feature pack to run our application, configure the runtimeArtifact in the liberty-maven-plugin configuration to replace the default openlibety-kernel. &lt;runtimeArtifact&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt;&lt;/runtimeArtifact&gt; The liberty.runtime.version property is defined in the properties section. &lt;liberty.runtime.version&gt;21.0.0.1-beta&lt;/liberty.runtime.version&gt; Run the following command to deploy our application to the Open Liberty server. mvn clean liberty:run You will see the following message in the console. [INFO] --- liberty-maven-plugin:3.3.1:run (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Running maven-compiler-plugin:compile[INFO] Changes detected - recompiling the module![INFO] Compiling 4 source files to D:\hantsylabs\jakartaee9-starter-boilerplate\target\classes[INFO] Running maven-resources-plugin:resources[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.[INFO] Copying 1 resource[INFO] Running liberty:create[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Installing assembly...[INFO] Expanding: C:\Users\hantsy\.m2\repository\io\openliberty\beta\openliberty-jakartaee9\21.0.0.1-beta\openliberty-jakartaee9-21.0.0.1-beta.zip into D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty[INFO] CWWKM2143I: Server defaultServer does not exist. Now creating...[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, create, defaultServer].[INFO] Server defaultServer created.[INFO] CWWKM2129I: Server defaultServer has been created at D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] Running liberty:install-feature[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[WARNING] Features that are not included with the beta runtime cannot be installed. Features that are included with the beta runtime can be enabled by adding them to your server.xml file.[INFO] Running liberty:deploy[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, run, defaultServer].[INFO] Launching defaultServer (Open Liberty 21.0.0.1-beta/wlp-1.0.47.cl201220201111-0736) on OpenJDK 64-Bit Server VM, version 11.0.7+10 (en_US)[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] [AUDIT ] CWWKE0001I: The server defaultServer has been launched.[INFO] [WARNING ] CWWKS3103W: There are no users defined for the BasicRegistry configuration of ID com.ibm.ws.security.registry.basic.config[basic].[INFO] [AUDIT ] CWWKZ0058I: Monitoring dropins for applications.[INFO] [AUDIT ] CWPKI0820A: The default keystore has been created using the &#39;keystore_password&#39; environment variable.[INFO] [AUDIT ] CWWKS4104A: LTPA keys created in 1.056 seconds. LTPA key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/ltpa.keys[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 6.360 seconds.[INFO] [AUDIT ] CWWKF0012I: The server installed the following features: [appClientSupport-2.0, appSecurity-4.0, beanValidation-3.0, cdi-3.0, concurrent-2.0, connectors-2.0, connectorsInboundSecurity-2.0, distributedMap-1.0, enterpriseBeans-4.0, enterpriseBeansHome-4.0, enterpriseBeansLite-4.0, enterpriseBeansPersistentTimer-4.0, enterpriseBeansRemote-4.0, expressionLanguage-4.0, faces-3.0, jacc-2.0, jakartaee-9.0, jaspic-2.0, jaxb-3.0, jdbc-4.2, jndi-1.0, json-1.0, jsonb-2.0, jsonp-2.0, mail-2.0, managedBeans-2.0, mdb-4.0, messaging-3.0, messagingClient-3.0, messagingSecurity-3.0, messagingServer-3.0, pages-3.0, persistence-3.0, persistenceContainer-3.0, restConnector-2.0, restfulWS-3.0, restfulWSClient-3.0, servlet-5.0, ssl-1.0, webProfile-9.0, websocket-2.0].[INFO] [AUDIT ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 52.202 seconds.[INFO] [AUDIT ] CWPKI0803A: SSL certificate created in 8.997 seconds. SSL key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/key.p12[INFO] [AUDIT ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService. Note: The beta feature pack use a different groupId (io.openliberty.beta )in the Maven archetype. To undeploy the applicaiton and stop the server, just send a CTRL+C to the console, you will see the following info. [INFO] [AUDIT ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[INFO] [AUDIT ] CWWKI0002I: The CORBA name server is no longer available at corbaloc:iiop:localhost:2809/NameService. You can also specify a installDirectory property in the plugin configuration to use an existing Open Liberty server. In a CI server , to prepare an Open Liberty server from scratch, add a dependency:unpack to retrieve the Open Liberty archive from Maven Central directly. &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;${maven-dependency-plugin.version}&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;default-unpack&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt; &lt;type&gt;zip&lt;/type&gt; &lt;overWrite&gt;false&lt;/overWrite&gt; &lt;outputDirectory&gt;${project.build.directory}/liberty &lt;/outputDirectory&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt;&lt;/plugin&gt;&lt;!-- Enable liberty-maven-plugin --&gt;&lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt; &lt;configuration&gt; &lt;installDirectory&gt;${project.build.directory}/liberty/wlp&lt;/installDirectory&gt; &lt;/configuration&gt;&lt;/plugin&gt; Now run the following command to deploy our application to Open Liberty. mvn clean package liberty:start liberty:deploy NOTE: We do not use run goal here, because it will clean the target folder at the initial stage, which will remove the downloaded Open Liberty dist. You will the following message when executing start and deploy goals. [INFO] --- liberty-maven-plugin:3.3.1:start (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] CWWKM2107I: Installation type is pre-existing; skipping installation.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, start, defaultServer].[INFO] Starting server defaultServer.[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] Server defaultServer started.[INFO] Waiting up to 30 seconds for server confirmation: CWWKF0011I to be found in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log[INFO] CWWKM2010I: Searching for CWWKF0011I in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 30 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:08:783 CST] 00000022 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 53.584 seconds..[INFO][INFO] --- liberty-maven-plugin:3.3.1:deploy (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] CWWKM2010I: Searching for CWWKZ0001I.*jakartaee9-starter-boilerplate in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 40 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:16:858 CST] 00000028 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.990 seconds.. In the startup stage, it will update the Open Liberty server config with the one in your project if it is existed. An example server.xml file is like this. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;server description=&quot;new server&quot;&gt; &lt;!-- Enable features --&gt; &lt;featureManager&gt; &lt;feature&gt;jakartaee-9.0&lt;/feature&gt; &lt;/featureManager&gt; &lt;!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. --&gt; &lt;!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element. Then uncomment the keyStore element. --&gt; &lt;!-- &lt;keyStore password=&quot;&quot;/&gt; --&gt; &lt;!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password, generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element. Then uncomment the user element. --&gt; &lt;basicRegistry id=&quot;basic&quot; realm=&quot;BasicRealm&quot;&gt; &lt;!-- &lt;user name=&quot;yourUserName&quot; password=&quot;&quot; /&gt; --&gt; &lt;/basicRegistry&gt; &lt;!-- To access this server from a remote client add a host attribute to the following element, e.g. host=&quot;*&quot; --&gt; &lt;httpEndpoint id=&quot;defaultHttpEndpoint&quot; httpPort=&quot;9080&quot; httpsPort=&quot;9443&quot; /&gt; &lt;!-- Automatically expand WAR files and EAR files --&gt; &lt;applicationManager autoExpand=&quot;true&quot;/&gt; &lt;/server&gt; To undeploy and stop the Open Liberty server, execute the following command . mvn liberty:undeploy mvn liberty:stop You can also configure the installDirectory property to use the location of your local Open Liberty server. &lt;configuration&gt; &lt;installDirectory&gt;D:/appsvr/wlp&lt;/installDirectory&gt; ...&lt;/configuration&gt; The liberty-maven-plugin does not support to deploy applications to a running server, see OpenLiberty/ci.maven#16 for details. &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to Open Liberty was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;" />
<meta property="og:description" content="Open Liberty has provided a standalone preview distribution for Jakarta EE 9 in the past development iterations. At the moment I wrote this post, the latest version is 21.0.0.1-beta. Open Liberty follows a monthly publication cycle, I think the stale version will be provided in the next months. Go to the Download page and switch to Beta tab, there are two package options in the table. Jakarta EE 9 Beta FeaturesAll Beta Features And make sure you are downloading the Jakarta EE 9 Beta Features. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6Open Liberty 21.0.0.1-beta Deploying to Open Liberty manually Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Enter the Open Liberty folder, start up the Open Liberty server. # cd wlp\bin # server start // `server run` to show logs in the fontend consoleStarting server defaultServer.CWWKE0953W: This version of Open Liberty is an unsupported early release version.Server defaultServer started. If you are the first time to run server, it will create a server profile for you. It will create a new folder named defaultServer in the usr/servers folder to prepare all resources of a jakartaee-9.0 feature pack, check the usr/servers/defaultServer/server.xml file for details . NOTE: The server profile is similar to the domain concept in other application servers, such as Glassfish, WildFly, etc. To deploy our application, just copy the war to the wlp/usr/servers/defaultServer/dropins folder. In the usr/servers/defaultServer/logs/messages.log file, you will see the deployment progress. [11/24/20, 16:00:07:304 CST] 00000046 com.ibm.ws.app.manager.AppMessageHelper I CWWKZ0018I: Starting application jakartaee9-starter-boilerplate.[11/24/20, 16:00:07:304 CST] 00000046 bm.ws.app.manager.war.internal.WARDeployedAppInfoFactoryImpl I CWWKZ0133I: The jakartaee9-starter-boilerplate application at the D:\appsvr\wlp\usr\servers\defaultServer\dropins\jakartaee9-starter-boilerplate.war location is being expanded to the D:\appsvr\wlp\usr\servers\defaultServer\apps\expanded\jakartaee9-starter-boilerplate.war directory.[11/24/20, 16:00:09:629 CST] 00000046 org.jboss.weld.Version I WELD-000900: 4.0.0 (Alpha3)[11/24/20, 16:00:10:709 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.config.annotation.CdiAnnotationProviderExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:10:726 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.cdi.JsfArtifactProducerExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:11:770 CST] 00000046 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: jakartaee9-starter-boilerplate.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.webcontainer I SRVE0250I: Web Module jakartaee9-starter-boilerplate has been bound to default_host.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/jakartaee9-starter-boilerplate[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.[11/24/20, 16:00:11:864 CST] 00000046 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.[11/24/20, 16:00:11:896 CST] 0000004e org.apache.myfaces.ee.MyFacesContainerInitializer I Using org.apache.myfaces.ee.MyFacesContainerInitializer[11/24/20, 16:00:12:005 CST] 0000004e com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.701 seconds.[11/24/20, 16:00:12:370 CST] 0000004e org.jboss.resteasy.resteasy_jaxrs.i18n I RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy[11/24/20, 16:00:12:433 CST] 0000004e com.ibm.ws.webcontainer.servlet I SRVE0242I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Initialization successful. To undeploy the application, just remove the war file from the wlp/usr/servers/defaultServer/dropins folder. Check the usr/servers/defaultServer/logs/messages.log file, you will see the log like this. [11/24/20, 16:04:13:245 CST] 00000066 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:04:13:248 CST] 00000066 com.ibm.ws.webcontainer.servlet I SRVE0253I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Destroy successful.[11/24/20, 16:04:13:281 CST] 00000066 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[11/24/20, 16:04:13:359 CST] 00000027 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml. Using Liberty Maven Plugin Declare a liberty-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt;&lt;/plugin&gt; When simply running liberty:run , it will retrieve the latest io.openliberty:openliberty-kernel and install required features defined in your project specific src/main/liberty/config/server.xml file, then start the server and deploy your application to this server. To use the latest Open Liberty Jakarta EE 9 beta feature pack to run our application, configure the runtimeArtifact in the liberty-maven-plugin configuration to replace the default openlibety-kernel. &lt;runtimeArtifact&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt;&lt;/runtimeArtifact&gt; The liberty.runtime.version property is defined in the properties section. &lt;liberty.runtime.version&gt;21.0.0.1-beta&lt;/liberty.runtime.version&gt; Run the following command to deploy our application to the Open Liberty server. mvn clean liberty:run You will see the following message in the console. [INFO] --- liberty-maven-plugin:3.3.1:run (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Running maven-compiler-plugin:compile[INFO] Changes detected - recompiling the module![INFO] Compiling 4 source files to D:\hantsylabs\jakartaee9-starter-boilerplate\target\classes[INFO] Running maven-resources-plugin:resources[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.[INFO] Copying 1 resource[INFO] Running liberty:create[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Installing assembly...[INFO] Expanding: C:\Users\hantsy\.m2\repository\io\openliberty\beta\openliberty-jakartaee9\21.0.0.1-beta\openliberty-jakartaee9-21.0.0.1-beta.zip into D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty[INFO] CWWKM2143I: Server defaultServer does not exist. Now creating...[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, create, defaultServer].[INFO] Server defaultServer created.[INFO] CWWKM2129I: Server defaultServer has been created at D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] Running liberty:install-feature[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[WARNING] Features that are not included with the beta runtime cannot be installed. Features that are included with the beta runtime can be enabled by adding them to your server.xml file.[INFO] Running liberty:deploy[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, run, defaultServer].[INFO] Launching defaultServer (Open Liberty 21.0.0.1-beta/wlp-1.0.47.cl201220201111-0736) on OpenJDK 64-Bit Server VM, version 11.0.7+10 (en_US)[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] [AUDIT ] CWWKE0001I: The server defaultServer has been launched.[INFO] [WARNING ] CWWKS3103W: There are no users defined for the BasicRegistry configuration of ID com.ibm.ws.security.registry.basic.config[basic].[INFO] [AUDIT ] CWWKZ0058I: Monitoring dropins for applications.[INFO] [AUDIT ] CWPKI0820A: The default keystore has been created using the &#39;keystore_password&#39; environment variable.[INFO] [AUDIT ] CWWKS4104A: LTPA keys created in 1.056 seconds. LTPA key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/ltpa.keys[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 6.360 seconds.[INFO] [AUDIT ] CWWKF0012I: The server installed the following features: [appClientSupport-2.0, appSecurity-4.0, beanValidation-3.0, cdi-3.0, concurrent-2.0, connectors-2.0, connectorsInboundSecurity-2.0, distributedMap-1.0, enterpriseBeans-4.0, enterpriseBeansHome-4.0, enterpriseBeansLite-4.0, enterpriseBeansPersistentTimer-4.0, enterpriseBeansRemote-4.0, expressionLanguage-4.0, faces-3.0, jacc-2.0, jakartaee-9.0, jaspic-2.0, jaxb-3.0, jdbc-4.2, jndi-1.0, json-1.0, jsonb-2.0, jsonp-2.0, mail-2.0, managedBeans-2.0, mdb-4.0, messaging-3.0, messagingClient-3.0, messagingSecurity-3.0, messagingServer-3.0, pages-3.0, persistence-3.0, persistenceContainer-3.0, restConnector-2.0, restfulWS-3.0, restfulWSClient-3.0, servlet-5.0, ssl-1.0, webProfile-9.0, websocket-2.0].[INFO] [AUDIT ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 52.202 seconds.[INFO] [AUDIT ] CWPKI0803A: SSL certificate created in 8.997 seconds. SSL key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/key.p12[INFO] [AUDIT ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService. Note: The beta feature pack use a different groupId (io.openliberty.beta )in the Maven archetype. To undeploy the applicaiton and stop the server, just send a CTRL+C to the console, you will see the following info. [INFO] [AUDIT ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[INFO] [AUDIT ] CWWKI0002I: The CORBA name server is no longer available at corbaloc:iiop:localhost:2809/NameService. You can also specify a installDirectory property in the plugin configuration to use an existing Open Liberty server. In a CI server , to prepare an Open Liberty server from scratch, add a dependency:unpack to retrieve the Open Liberty archive from Maven Central directly. &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;${maven-dependency-plugin.version}&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;default-unpack&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt; &lt;type&gt;zip&lt;/type&gt; &lt;overWrite&gt;false&lt;/overWrite&gt; &lt;outputDirectory&gt;${project.build.directory}/liberty &lt;/outputDirectory&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt;&lt;/plugin&gt;&lt;!-- Enable liberty-maven-plugin --&gt;&lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt; &lt;configuration&gt; &lt;installDirectory&gt;${project.build.directory}/liberty/wlp&lt;/installDirectory&gt; &lt;/configuration&gt;&lt;/plugin&gt; Now run the following command to deploy our application to Open Liberty. mvn clean package liberty:start liberty:deploy NOTE: We do not use run goal here, because it will clean the target folder at the initial stage, which will remove the downloaded Open Liberty dist. You will the following message when executing start and deploy goals. [INFO] --- liberty-maven-plugin:3.3.1:start (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] CWWKM2107I: Installation type is pre-existing; skipping installation.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, start, defaultServer].[INFO] Starting server defaultServer.[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] Server defaultServer started.[INFO] Waiting up to 30 seconds for server confirmation: CWWKF0011I to be found in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log[INFO] CWWKM2010I: Searching for CWWKF0011I in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 30 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:08:783 CST] 00000022 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 53.584 seconds..[INFO][INFO] --- liberty-maven-plugin:3.3.1:deploy (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] CWWKM2010I: Searching for CWWKZ0001I.*jakartaee9-starter-boilerplate in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 40 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:16:858 CST] 00000028 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.990 seconds.. In the startup stage, it will update the Open Liberty server config with the one in your project if it is existed. An example server.xml file is like this. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;server description=&quot;new server&quot;&gt; &lt;!-- Enable features --&gt; &lt;featureManager&gt; &lt;feature&gt;jakartaee-9.0&lt;/feature&gt; &lt;/featureManager&gt; &lt;!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. --&gt; &lt;!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element. Then uncomment the keyStore element. --&gt; &lt;!-- &lt;keyStore password=&quot;&quot;/&gt; --&gt; &lt;!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password, generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element. Then uncomment the user element. --&gt; &lt;basicRegistry id=&quot;basic&quot; realm=&quot;BasicRealm&quot;&gt; &lt;!-- &lt;user name=&quot;yourUserName&quot; password=&quot;&quot; /&gt; --&gt; &lt;/basicRegistry&gt; &lt;!-- To access this server from a remote client add a host attribute to the following element, e.g. host=&quot;*&quot; --&gt; &lt;httpEndpoint id=&quot;defaultHttpEndpoint&quot; httpPort=&quot;9080&quot; httpsPort=&quot;9443&quot; /&gt; &lt;!-- Automatically expand WAR files and EAR files --&gt; &lt;applicationManager autoExpand=&quot;true&quot;/&gt; &lt;/server&gt; To undeploy and stop the Open Liberty server, execute the following command . mvn liberty:undeploy mvn liberty:stop You can also configure the installDirectory property to use the location of your local Open Liberty server. &lt;configuration&gt; &lt;installDirectory&gt;D:/appsvr/wlp&lt;/installDirectory&gt; ...&lt;/configuration&gt; The liberty-maven-plugin does not support to deploy applications to a running server, see OpenLiberty/ci.maven#16 for details. &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to Open Liberty was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;" />
<meta property="og:site_name" content="blank" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-11-29T00:00:00+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Deploying Jakarta EE 9 applications to Open Liberty" />
<script type="application/ld+json">
{"datePublished":"2020-11-29T00:00:00+00:00","description":"Open Liberty has provided a standalone preview distribution for Jakarta EE 9 in the past development iterations. At the moment I wrote this post, the latest version is 21.0.0.1-beta. Open Liberty follows a monthly publication cycle, I think the stale version will be provided in the next months. Go to the Download page and switch to Beta tab, there are two package options in the table. Jakarta EE 9 Beta FeaturesAll Beta Features And make sure you are downloading the Jakarta EE 9 Beta Features. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6Open Liberty 21.0.0.1-beta Deploying to Open Liberty manually Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Enter the Open Liberty folder, start up the Open Liberty server. # cd wlp\\bin # server start // `server run` to show logs in the fontend consoleStarting server defaultServer.CWWKE0953W: This version of Open Liberty is an unsupported early release version.Server defaultServer started. If you are the first time to run server, it will create a server profile for you. It will create a new folder named defaultServer in the usr/servers folder to prepare all resources of a jakartaee-9.0 feature pack, check the usr/servers/defaultServer/server.xml file for details . NOTE: The server profile is similar to the domain concept in other application servers, such as Glassfish, WildFly, etc. To deploy our application, just copy the war to the wlp/usr/servers/defaultServer/dropins folder. In the usr/servers/defaultServer/logs/messages.log file, you will see the deployment progress. [11/24/20, 16:00:07:304 CST] 00000046 com.ibm.ws.app.manager.AppMessageHelper I CWWKZ0018I: Starting application jakartaee9-starter-boilerplate.[11/24/20, 16:00:07:304 CST] 00000046 bm.ws.app.manager.war.internal.WARDeployedAppInfoFactoryImpl I CWWKZ0133I: The jakartaee9-starter-boilerplate application at the D:\\appsvr\\wlp\\usr\\servers\\defaultServer\\dropins\\jakartaee9-starter-boilerplate.war location is being expanded to the D:\\appsvr\\wlp\\usr\\servers\\defaultServer\\apps\\expanded\\jakartaee9-starter-boilerplate.war directory.[11/24/20, 16:00:09:629 CST] 00000046 org.jboss.weld.Version I WELD-000900: 4.0.0 (Alpha3)[11/24/20, 16:00:10:709 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.config.annotation.CdiAnnotationProviderExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:10:726 CST] 00000046 org.jboss.weld.Event I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.cdi.JsfArtifactProducerExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.[11/24/20, 16:00:11:770 CST] 00000046 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: jakartaee9-starter-boilerplate.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.webcontainer I SRVE0250I: Web Module jakartaee9-starter-boilerplate has been bound to default_host.[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/jakartaee9-starter-boilerplate[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.[11/24/20, 16:00:11:864 CST] 00000046 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\\appsvr\\wlp\\usr\\servers\\defaultServer\\logs\\state\\plugin-cfg.xml.[11/24/20, 16:00:11:896 CST] 0000004e org.apache.myfaces.ee.MyFacesContainerInitializer I Using org.apache.myfaces.ee.MyFacesContainerInitializer[11/24/20, 16:00:12:005 CST] 0000004e com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.701 seconds.[11/24/20, 16:00:12:370 CST] 0000004e org.jboss.resteasy.resteasy_jaxrs.i18n I RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy[11/24/20, 16:00:12:433 CST] 0000004e com.ibm.ws.webcontainer.servlet I SRVE0242I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Initialization successful. To undeploy the application, just remove the war file from the wlp/usr/servers/defaultServer/dropins folder. Check the usr/servers/defaultServer/logs/messages.log file, you will see the log like this. [11/24/20, 16:04:13:245 CST] 00000066 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[11/24/20, 16:04:13:248 CST] 00000066 com.ibm.ws.webcontainer.servlet I SRVE0253I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Destroy successful.[11/24/20, 16:04:13:281 CST] 00000066 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[11/24/20, 16:04:13:359 CST] 00000027 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\\appsvr\\wlp\\usr\\servers\\defaultServer\\logs\\state\\plugin-cfg.xml. Using Liberty Maven Plugin Declare a liberty-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt;&lt;/plugin&gt; When simply running liberty:run , it will retrieve the latest io.openliberty:openliberty-kernel and install required features defined in your project specific src/main/liberty/config/server.xml file, then start the server and deploy your application to this server. To use the latest Open Liberty Jakarta EE 9 beta feature pack to run our application, configure the runtimeArtifact in the liberty-maven-plugin configuration to replace the default openlibety-kernel. &lt;runtimeArtifact&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt;&lt;/runtimeArtifact&gt; The liberty.runtime.version property is defined in the properties section. &lt;liberty.runtime.version&gt;21.0.0.1-beta&lt;/liberty.runtime.version&gt; Run the following command to deploy our application to the Open Liberty server. mvn clean liberty:run You will see the following message in the console. [INFO] --- liberty-maven-plugin:3.3.1:run (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] Running maven-compiler-plugin:compile[INFO] Changes detected - recompiling the module![INFO] Compiling 4 source files to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\classes[INFO] Running maven-resources-plugin:resources[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.[INFO] Copying 1 resource[INFO] Running liberty:create[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] Installing assembly...[INFO] Expanding: C:\\Users\\hantsy\\.m2\\repository\\io\\openliberty\\beta\\openliberty-jakartaee9\\21.0.0.1-beta\\openliberty-jakartaee9-21.0.0.1-beta.zip into D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty[INFO] CWWKM2143I: Server defaultServer does not exist. Now creating...[INFO] CWWKM2001I: Invoke command is [&quot;D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\bin\\server.bat&quot;, create, defaultServer].[INFO] Server defaultServer created.[INFO] CWWKM2129I: Server defaultServer has been created at D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] Copying 1 file to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\\hantsylabs\\jakartaee9-starter-boilerplate\\src\\main\\liberty\\config\\server.xml.[INFO] Running liberty:install-feature[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[WARNING] Features that are not included with the beta runtime cannot be installed. Features that are included with the beta runtime can be enabled by adding them to your server.xml file.[INFO] Running liberty:deploy[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.[INFO] CWWKM2102I: Using installDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] Copying 1 file to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\\hantsylabs\\jakartaee9-starter-boilerplate\\src\\main\\liberty\\config\\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] Copying 1 file to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\\hantsylabs\\jakartaee9-starter-boilerplate\\src\\main\\liberty\\config\\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\bin\\server.bat&quot;, run, defaultServer].[INFO] Launching defaultServer (Open Liberty 21.0.0.1-beta/wlp-1.0.47.cl201220201111-0736) on OpenJDK 64-Bit Server VM, version 11.0.7+10 (en_US)[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] [AUDIT ] CWWKE0001I: The server defaultServer has been launched.[INFO] [WARNING ] CWWKS3103W: There are no users defined for the BasicRegistry configuration of ID com.ibm.ws.security.registry.basic.config[basic].[INFO] [AUDIT ] CWWKZ0058I: Monitoring dropins for applications.[INFO] [AUDIT ] CWPKI0820A: The default keystore has been created using the &#39;keystore_password&#39; environment variable.[INFO] [AUDIT ] CWWKS4104A: LTPA keys created in 1.056 seconds. LTPA key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/ltpa.keys[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 6.360 seconds.[INFO] [AUDIT ] CWWKF0012I: The server installed the following features: [appClientSupport-2.0, appSecurity-4.0, beanValidation-3.0, cdi-3.0, concurrent-2.0, connectors-2.0, connectorsInboundSecurity-2.0, distributedMap-1.0, enterpriseBeans-4.0, enterpriseBeansHome-4.0, enterpriseBeansLite-4.0, enterpriseBeansPersistentTimer-4.0, enterpriseBeansRemote-4.0, expressionLanguage-4.0, faces-3.0, jacc-2.0, jakartaee-9.0, jaspic-2.0, jaxb-3.0, jdbc-4.2, jndi-1.0, json-1.0, jsonb-2.0, jsonp-2.0, mail-2.0, managedBeans-2.0, mdb-4.0, messaging-3.0, messagingClient-3.0, messagingSecurity-3.0, messagingServer-3.0, pages-3.0, persistence-3.0, persistenceContainer-3.0, restConnector-2.0, restfulWS-3.0, restfulWSClient-3.0, servlet-5.0, ssl-1.0, webProfile-9.0, websocket-2.0].[INFO] [AUDIT ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 52.202 seconds.[INFO] [AUDIT ] CWPKI0803A: SSL certificate created in 8.997 seconds. SSL key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/key.p12[INFO] [AUDIT ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService. Note: The beta feature pack use a different groupId (io.openliberty.beta )in the Maven archetype. To undeploy the applicaiton and stop the server, just send a CTRL+C to the console, you will see the following info. [INFO] [AUDIT ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/jakartaee9-starter-boilerplate/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/ibm/api/[INFO] [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/IBMJMXConnectorREST/[INFO] [AUDIT ] CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.[INFO] [AUDIT ] CWWKI0002I: The CORBA name server is no longer available at corbaloc:iiop:localhost:2809/NameService. You can also specify a installDirectory property in the plugin configuration to use an existing Open Liberty server. In a CI server , to prepare an Open Liberty server from scratch, add a dependency:unpack to retrieve the Open Liberty archive from Maven Central directly. &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;${maven-dependency-plugin.version}&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;default-unpack&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt; &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt; &lt;version&gt;${liberty.runtime.version}&lt;/version&gt; &lt;type&gt;zip&lt;/type&gt; &lt;overWrite&gt;false&lt;/overWrite&gt; &lt;outputDirectory&gt;${project.build.directory}/liberty &lt;/outputDirectory&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt;&lt;/plugin&gt;&lt;!-- Enable liberty-maven-plugin --&gt;&lt;plugin&gt; &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt; &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt; &lt;configuration&gt; &lt;installDirectory&gt;${project.build.directory}/liberty/wlp&lt;/installDirectory&gt; &lt;/configuration&gt;&lt;/plugin&gt; Now run the following command to deploy our application to Open Liberty. mvn clean package liberty:start liberty:deploy NOTE: We do not use run goal here, because it will clean the target folder at the initial stage, which will remove the downloaded Open Liberty dist. You will the following message when executing start and deploy goals. [INFO] --- liberty-maven-plugin:3.3.1:start (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] CWWKM2107I: Installation type is pre-existing; skipping installation.[INFO] Copying 1 file to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\\hantsylabs\\jakartaee9-starter-boilerplate\\src\\main\\liberty\\config\\server.xml.[INFO] CWWKM2001I: Invoke command is [&quot;D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\bin\\server.bat&quot;, start, defaultServer].[INFO] Starting server defaultServer.[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.[INFO] Server defaultServer started.[INFO] Waiting up to 30 seconds for server confirmation: CWWKF0011I to be found in D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer\\logs\\messages.log[INFO] CWWKM2010I: Searching for CWWKF0011I in D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer\\logs\\messages.log. This search will timeout after 30 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:08:783 CST] 00000022 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 53.584 seconds..[INFO][INFO] --- liberty-maven-plugin:3.3.1:deploy (default-cli) @ jakartaee9-starter-boilerplate ---[INFO] CWWKM2102I: Using pre-installed assembly : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp.[INFO] CWWKM2102I: Using serverName : defaultServer.[INFO] CWWKM2102I: Using serverDirectory : D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer.[INFO] Copying 1 file to D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer[INFO] CWWKM2144I: Update server configuration file server.xml from D:\\hantsylabs\\jakartaee9-starter-boilerplate\\src\\main\\liberty\\config\\server.xml.[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.[INFO] CWWKM2010I: Searching for CWWKZ0001I.*jakartaee9-starter-boilerplate in D:\\hantsylabs\\jakartaee9-starter-boilerplate\\target\\liberty\\wlp\\usr\\servers\\defaultServer\\logs\\messages.log. This search will timeout after 40 seconds.[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:16:858 CST] 00000028 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.990 seconds.. In the startup stage, it will update the Open Liberty server config with the one in your project if it is existed. An example server.xml file is like this. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;server description=&quot;new server&quot;&gt; &lt;!-- Enable features --&gt; &lt;featureManager&gt; &lt;feature&gt;jakartaee-9.0&lt;/feature&gt; &lt;/featureManager&gt; &lt;!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. --&gt; &lt;!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element. Then uncomment the keyStore element. --&gt; &lt;!-- &lt;keyStore password=&quot;&quot;/&gt; --&gt; &lt;!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password, generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element. Then uncomment the user element. --&gt; &lt;basicRegistry id=&quot;basic&quot; realm=&quot;BasicRealm&quot;&gt; &lt;!-- &lt;user name=&quot;yourUserName&quot; password=&quot;&quot; /&gt; --&gt; &lt;/basicRegistry&gt; &lt;!-- To access this server from a remote client add a host attribute to the following element, e.g. host=&quot;*&quot; --&gt; &lt;httpEndpoint id=&quot;defaultHttpEndpoint&quot; httpPort=&quot;9080&quot; httpsPort=&quot;9443&quot; /&gt; &lt;!-- Automatically expand WAR files and EAR files --&gt; &lt;applicationManager autoExpand=&quot;true&quot;/&gt; &lt;/server&gt; To undeploy and stop the Open Liberty server, execute the following command . mvn liberty:undeploy mvn liberty:stop You can also configure the installDirectory property to use the location of your local Open Liberty server. &lt;configuration&gt; &lt;installDirectory&gt;D:/appsvr/wlp&lt;/installDirectory&gt; ...&lt;/configuration&gt; The liberty-maven-plugin does not support to deploy applications to a running server, see OpenLiberty/ci.maven#16 for details. &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to Open Liberty was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;","mainEntityOfPage":{"@type":"WebPage","@id":"/blog/2020/deploying-jakarta-ee-9-applications-to-open-liberty/"},"url":"/blog/2020/deploying-jakarta-ee-9-applications-to-open-liberty/","@type":"BlogPosting","headline":"Deploying Jakarta EE 9 applications to Open Liberty","dateModified":"2020-11-29T00:00:00+00:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->

</head>

<body
  class="fixed-top-nav ">

  <!-- Header -->

  <header>

    <!-- Nav Bar -->
    <nav id="navbar" class="navbar navbar-light navbar-expand-sm fixed-top">
    <div class="container">
      
      <a class="navbar-brand title font-weight-lighter" href="/">
       <span class="font-weight-bold">Hantsy</span>   Bai
      </a>
      
      <!-- Navbar Toggle -->
      <button class="navbar-toggler collapsed ml-auto" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar top-bar"></span>
        <span class="icon-bar middle-bar"></span>
        <span class="icon-bar bottom-bar"></span>
      </button>
      <div class="collapse navbar-collapse text-right" id="navbarNav">
        <ul class="navbar-nav ml-auto flex-nowrap">
          <!-- About -->
          <li class="nav-item ">
            <a class="nav-link" href="/">
              about
              
            </a>
          </li>
          
          <!-- Blog -->
          <li class="nav-item active">
            <a class="nav-link" href="/blog/">
              blog
              
            </a>
          </li>
          
          <!-- Other pages -->
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/projects/">
                projects
                
              </a>
          </li>
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/publications/">
                publications
                
              </a>
          </li>
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/service/">
                service
                
              </a>
          </li>
          
          
          
            <div class = "toggle-container">
              <a id = "light-toggle">
                  <i class="fas fa-moon"></i>
                  <i class="fas fa-sun"></i>
              </a>
            </div>
          
        </ul>
      </div>
    </div>
  </nav>

</header>


  <!-- Content -->

  <div class="container mt-5">
    

<div class="post">

  <header class="post-header">
    <h1 class="post-title">Deploying Jakarta EE 9 applications to Open Liberty</h1>
    <p class="post-meta">November 29, 2020</p>
  </header>

  <article class="post-content">
    <figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZgar-TMaqJ9r-ovXsLz_A.png" /></figure><p><a href="https://openliberty.io">Open Liberty</a> has provided a standalone preview distribution for Jakarta EE 9 in the past development iterations. At the moment I wrote this post, the latest version is 21.0.0.1-beta. Open Liberty follows a monthly publication cycle, I think the stale version will be provided in the next months.</p><p>Go to the <a href="https://openliberty.io/downloads">Download</a> page and switch to <em>Beta</em> tab, there are two package options in the table.</p><ul><li>Jakarta EE 9 Beta Features</li><li>All Beta Features</li></ul><p>And make sure you are downloading the <a href="https://openliberty.io/downloads/#runtime_betas">Jakarta EE 9 Beta Features</a>.</p><h3>Prerequisites</h3><p>Make sure you have installed the following software.</p><ul><li>Java 8 or Java 11</li><li>Apache Maven 3.6</li><li>Open Liberty 21.0.0.1-beta</li></ul><h3>Deploying to Open Liberty manually</h3><p>Clone the <a href="https://github.com/hantsy/jakartaee9-starter-boilerplate">source codes</a> from my github account, and then build the project.</p><pre>mvn clean package</pre><p>When it is done, there is a <em>jakartaee9-starter-boilerplate.war</em> file packaged in the <em>target</em> folder.</p><p>Enter the Open Liberty folder, start up the Open Liberty server.</p><pre># cd wlp\bin</pre><pre># server start // `server run` to show logs in the fontend console<br>Starting server defaultServer.<br>CWWKE0953W: This version of Open Liberty is an unsupported early release version.<br>Server defaultServer started.</pre><p>If you are the first time to run server, it will create a <em>server profile</em> for you. It will create a new folder named <em>defaultServer</em> in the <em>usr/servers</em> folder to prepare all resources of a jakartaee-9.0 feature pack, check the <em>usr/servers/defaultServer/server.xml</em> file for details .</p><blockquote><em>NOTE: The server profile is similar to the domain concept in other application servers, such as Glassfish, WildFly, etc.</em></blockquote><p>To deploy our application, just copy the war to the <em>wlp/usr/servers/defaultServer/dropins</em> folder.</p><p>In the <em>usr/servers/defaultServer/logs/messages.log</em> file, you will see the deployment progress.</p><pre>[11/24/20, 16:00:07:304 CST] 00000046 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application jakartaee9-starter-boilerplate.<br>[11/24/20, 16:00:07:304 CST] 00000046 bm.ws.app.manager.war.internal.WARDeployedAppInfoFactoryImpl I CWWKZ0133I: The jakartaee9-starter-boilerplate application at the D:\appsvr\wlp\usr\servers\defaultServer\dropins\jakartaee9-starter-boilerplate.war location is being expanded to the D:\appsvr\wlp\usr\servers\defaultServer\apps\expanded\jakartaee9-starter-boilerplate.war directory.<br>[11/24/20, 16:00:09:629 CST] 00000046 org.jboss.weld.Version                                       I WELD-000900: 4.0.0 (Alpha3)<br>[11/24/20, 16:00:10:709 CST] 00000046 org.jboss.weld.Event                                         I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.config.annotation.CdiAnnotationProviderExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.<br>[11/24/20, 16:00:10:726 CST] 00000046 org.jboss.weld.Event                                         I WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.cdi.JsfArtifactProducerExtension.processAnnotatedType(@Observes ProcessAnnotatedType&lt;T&gt;, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.<br>[11/24/20, 16:00:11:770 CST] 00000046 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: jakartaee9-starter-boilerplate.<br>[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module jakartaee9-starter-boilerplate has been bound to default_host.<br>[11/24/20, 16:00:11:786 CST] 00000046 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): <a href="http://localhost:9080/jakartaee9-starter-boilerplate/">http://localhost:9080/jakartaee9-starter-boilerplate/</a><br>[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/jakartaee9-starter-boilerplate<br>[11/24/20, 16:00:11:786 CST] 0000004e com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.<br>[11/24/20, 16:00:11:864 CST] 00000046 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.<br>[11/24/20, 16:00:11:896 CST] 0000004e org.apache.myfaces.ee.MyFacesContainerInitializer            I Using org.apache.myfaces.ee.MyFacesContainerInitializer<br>[11/24/20, 16:00:12:005 CST] 0000004e com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.701 seconds.<br>[11/24/20, 16:00:12:370 CST] 0000004e org.jboss.resteasy.resteasy_jaxrs.i18n                       I RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy<br>[11/24/20, 16:00:12:433 CST] 0000004e com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Initialization successful.</pre><p>To undeploy the application, just remove the war file from the <em>wlp/usr/servers/defaultServer/dropins</em> folder.</p><p>Check the <em>usr/servers/defaultServer/logs/messages.log</em> file, you will see the log like this.</p><pre>[11/24/20, 16:04:13:245 CST] 00000066 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0017I: Web application removed (default_host): <a href="http://localhost:9080/jakartaee9-starter-boilerplate/">http://localhost:9080/jakartaee9-starter-boilerplate/</a><br>[11/24/20, 16:04:13:248 CST] 00000066 com.ibm.ws.webcontainer.servlet                              I SRVE0253I: [jakartaee9-starter-boilerplate] [/jakartaee9-starter-boilerplate] [com.example.JaxrsActivator]: Destroy successful.<br>[11/24/20, 16:04:13:281 CST] 00000066 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.<br>[11/24/20, 16:04:13:359 CST] 00000027 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at D:\appsvr\wlp\usr\servers\defaultServer\logs\state\plugin-cfg.xml.</pre><h3>Using Liberty Maven Plugin</h3><p>Declare a liberty-maven-plugin configuration under build/plugins section in the project <em>pom.xml</em> file.</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt;<br>    &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt;<br>&lt;/plugin&gt;</pre><p>When simply running liberty:run , it will retrieve the latest io.openliberty:openliberty-kernel and install required features defined in your project specific src/main/liberty/config/server.xml file, then start the server and deploy your application to this server.</p><p>To use the latest Open Liberty Jakarta EE 9 beta feature pack to run our application, configure the runtimeArtifact in the liberty-maven-plugin configuration to replace the default openlibety-kernel.</p><pre>&lt;runtimeArtifact&gt;<br>    &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt;<br>    &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt;<br>    &lt;version&gt;${liberty.runtime.version}&lt;/version&gt;<br>&lt;/runtimeArtifact&gt;</pre><p>The liberty.runtime.version property is defined in the properties section.</p><pre>&lt;liberty.runtime.version&gt;21.0.0.1-beta&lt;/liberty.runtime.version&gt;</pre><p>Run the following command to deploy our application to the Open Liberty server.</p><pre>mvn clean liberty:run</pre><p>You will see the following message in the console.</p><pre>[INFO] --- liberty-maven-plugin:3.3.1:run (default-cli) @ jakartaee9-starter-boilerplate ---<br>[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.<br>[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.<br>[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] Running maven-compiler-plugin:compile<br>[INFO] Changes detected - recompiling the module!<br>[INFO] Compiling 4 source files to D:\hantsylabs\jakartaee9-starter-boilerplate\target\classes<br>[INFO] Running maven-resources-plugin:resources<br>[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.<br>[INFO] Copying 1 resource<br>[INFO] Running liberty:create<br>[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.<br>[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.<br>[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] Installing assembly...<br>[INFO] Expanding: C:\Users\hantsy\.m2\repository\io\openliberty\beta\openliberty-jakartaee9\21.0.0.1-beta\openliberty-jakartaee9-21.0.0.1-beta.zip into D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty<br>[INFO] CWWKM2143I: Server defaultServer does not exist. Now creating...<br>[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, create, defaultServer].<br>[INFO] Server defaultServer created.<br>[INFO] CWWKM2129I: Server defaultServer has been created at D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer<br>[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.<br>[INFO] Running liberty:install-feature<br>[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.<br>[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.<br>[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[WARNING] Features that are not included with the beta runtime cannot be installed. Features that are included with the beta runtime can be enabled by adding them to your server.xml file.<br>[INFO] Running liberty:deploy<br>[INFO] The runtimeArtifact version 21.0.0.1-beta is overwritten by the liberty.runtime.version value 21.0.0.1-beta.<br>[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty.beta:openliberty-jakartaee9:null:21.0.0.1-beta:zip.<br>[INFO] CWWKM2102I: Using installDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer<br>[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.<br>[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.<br>[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.<br>[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer<br>[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.<br>[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, run, defaultServer].<br>[INFO] Launching defaultServer (Open Liberty 21.0.0.1-beta/wlp-1.0.47.cl201220201111-0736) on OpenJDK 64-Bit Server VM, version 11.0.7+10 (en_US)<br>[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.<br>[INFO] [AUDIT   ] CWWKE0001I: The server defaultServer has been launched.<br>[INFO] [WARNING ] CWWKS3103W: There are no users defined for the BasicRegistry configuration of ID com.ibm.ws.security.registry.basic.config[basic].<br>[INFO] [AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.<br>[INFO] [AUDIT   ] CWPKI0820A: The default keystore has been created using the &#39;keystore_password&#39; environment variable.<br>[INFO] [AUDIT   ] CWWKS4104A: LTPA keys created in 1.056 seconds. LTPA key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/ltpa.keys<br>[INFO] [AUDIT   ] CWWKT0016I: Web application available (default_host): <a href="http://localhost:9080/ibm/api/">http://localhost:9080/ibm/api/</a><br>[INFO] [AUDIT   ] CWWKT0016I: Web application available (default_host): <a href="http://localhost:9080/IBMJMXConnectorREST/">http://localhost:9080/IBMJMXConnectorREST/</a><br>[INFO] [AUDIT   ] CWWKT0016I: Web application available (default_host): <a href="http://localhost:9080/jakartaee9-starter-boilerplate/">http://localhost:9080/jakartaee9-starter-boilerplate/</a><br>[INFO] [AUDIT   ] CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 6.360 seconds.<br>[INFO] [AUDIT   ] CWWKF0012I: The server installed the following features: [appClientSupport-2.0, appSecurity-4.0, beanValidation-3.0, cdi-3.0, concurrent-2.0, connectors-2.0, connectorsInboundSecurity-2.0, distributedMap-1.0, enterpriseBeans-4.0, enterpriseBeansHome-4.0, enterpriseBeansLite-4.0, enterpriseBeansPersistentTimer-4.0, enterpriseBeansRemote-4.0, expressionLanguage-4.0, faces-3.0, jacc-2.0, jakartaee-9.0, jaspic-2.0, jaxb-3.0, jdbc-4.2, jndi-1.0, json-1.0, jsonb-2.0, jsonp-2.0, mail-2.0, managedBeans-2.0, mdb-4.0, messaging-3.0, messagingClient-3.0, messagingSecurity-3.0, messagingServer-3.0, pages-3.0, persistence-3.0, persistenceContainer-3.0, restConnector-2.0, restfulWS-3.0, restfulWSClient-3.0, servlet-5.0, ssl-1.0, webProfile-9.0, websocket-2.0].<br>[INFO] [AUDIT   ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 52.202 seconds.<br>[INFO] [AUDIT   ] CWPKI0803A: SSL certificate created in 8.997 seconds. SSL key file: D:/hantsylabs/jakartaee9-starter-boilerplate/target/liberty/wlp/usr/servers/defaultServer/resources/security/key.p12<br>[INFO] [AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.</pre><blockquote><em>Note: The beta feature pack use a different </em><strong><em>groupId</em></strong><em> (</em><em>io.openliberty.beta )in the Maven archetype.</em></blockquote><p>To undeploy the applicaiton and stop the server, just send a CTRL+C to the console, you will see the following info.</p><pre>[INFO] [AUDIT   ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.<br>[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): <a href="http://localhost:9080/jakartaee9-starter-boilerplate/">http://localhost:9080/jakartaee9-starter-boilerplate/</a><br>[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): <a href="http://localhost:9080/ibm/api/">http://localhost:9080/ibm/api/</a><br>[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): <a href="http://localhost:9080/IBMJMXConnectorREST/">http://localhost:9080/IBMJMXConnectorREST/</a><br>[INFO] [AUDIT   ] CWWKZ0009I: The application jakartaee9-starter-boilerplate has stopped successfully.<br>[INFO] [AUDIT   ] CWWKI0002I: The CORBA name server is no longer available at corbaloc:iiop:localhost:2809/NameService.</pre><p>You can also specify a installDirectory property in the plugin <em>configuration</em> to use an existing Open Liberty server.</p><p>In a CI server , to prepare an Open Liberty server from scratch, add a dependency:unpack to retrieve the Open Liberty archive from Maven Central directly.</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>    &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;${maven-dependency-plugin.version}&lt;/version&gt;<br>    &lt;executions&gt;<br>        &lt;execution&gt;<br>            &lt;id&gt;default-unpack&lt;/id&gt;<br>            &lt;phase&gt;process-resources&lt;/phase&gt;<br>            &lt;goals&gt;<br>                &lt;goal&gt;unpack&lt;/goal&gt;<br>            &lt;/goals&gt;<br>            &lt;configuration&gt;<br>                &lt;artifactItems&gt;<br>                    &lt;artifactItem&gt;<br>                        &lt;groupId&gt;io.openliberty.beta&lt;/groupId&gt;<br>                        &lt;artifactId&gt;openliberty-jakartaee9&lt;/artifactId&gt;<br>                        &lt;version&gt;${liberty.runtime.version}&lt;/version&gt;<br>                        &lt;type&gt;zip&lt;/type&gt;<br>                        &lt;overWrite&gt;false&lt;/overWrite&gt;<br>                        &lt;outputDirectory&gt;${project.build.directory}/liberty<br>                        &lt;/outputDirectory&gt;<br>                    &lt;/artifactItem&gt;<br>                &lt;/artifactItems&gt;<br>            &lt;/configuration&gt;<br>        &lt;/execution&gt;<br>    &lt;/executions&gt;<br>&lt;/plugin&gt;<br>&lt;!-- Enable liberty-maven-plugin --&gt;<br>&lt;plugin&gt;<br>    &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt;<br>    &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;${liberty-maven-plugin.version}&lt;/version&gt;<br>    &lt;configuration&gt;<br>        &lt;installDirectory&gt;${project.build.directory}/liberty/wlp&lt;/installDirectory&gt;<br>    &lt;/configuration&gt;<br>&lt;/plugin&gt;</pre><p>Now run the following command to deploy our application to Open Liberty.</p><pre>mvn clean package liberty:start liberty:deploy</pre><blockquote><em>NOTE: We do not use </em><em>run goal here, because it will clean the </em><strong><em>target</em></strong><em> folder at the initial stage, which will remove the downloaded Open Liberty dist.</em></blockquote><p>You will the following message when executing start and deploy goals.</p><pre>[INFO] --- liberty-maven-plugin:3.3.1:start (default-cli) @ jakartaee9-starter-boilerplate ---<br>[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] CWWKM2107I: Installation type is pre-existing; skipping installation.<br>[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer<br>[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.<br>[INFO] CWWKM2001I: Invoke command is [&quot;D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\bin\server.bat&quot;, start, defaultServer].<br>[INFO] Starting server defaultServer.<br>[INFO] CWWKE0953W: This version of Open Liberty is an unsupported early release version.<br>[INFO] Server defaultServer started.<br>[INFO] Waiting up to 30 seconds for server confirmation:  CWWKF0011I to be found in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log<br>[INFO] CWWKM2010I: Searching for CWWKF0011I in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 30 seconds.<br>[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:08:783 CST] 00000022 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 53.584 seconds..<br>[INFO]<br>[INFO] --- liberty-maven-plugin:3.3.1:deploy (default-cli) @ jakartaee9-starter-boilerplate ---<br>[INFO] CWWKM2102I: Using pre-installed assembly : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp.<br>[INFO] CWWKM2102I: Using serverName : defaultServer.<br>[INFO] CWWKM2102I: Using serverDirectory : D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer.<br>[INFO] Copying 1 file to D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer<br>[INFO] CWWKM2144I: Update server configuration file server.xml from D:\hantsylabs\jakartaee9-starter-boilerplate\src\main\liberty\config\server.xml.<br>[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter &quot;appsDirectory&quot; value defaults to &quot;dropins&quot;.<br>[INFO] CWWKM2160I: Installing application jakartaee9-starter-boilerplate.war.xml.<br>[INFO] CWWKM2010I: Searching for CWWKZ0001I.*jakartaee9-starter-boilerplate in D:\hantsylabs\jakartaee9-starter-boilerplate\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 40 seconds.<br>[INFO] CWWKM2015I: Match number: 1 is [11/24/20, 17:38:16:858 CST] 00000028 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application jakartaee9-starter-boilerplate started in 4.990 seconds..</pre><p>In the startup stage, it will update the Open Liberty server config with the one in your project if it is existed. An example <em>server.xml</em> file is like this.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;server description=&quot;new server&quot;&gt;</pre><pre>    &lt;!-- Enable features --&gt;<br>    &lt;featureManager&gt;<br>        &lt;feature&gt;jakartaee-9.0&lt;/feature&gt;<br>    &lt;/featureManager&gt;</pre><pre>    &lt;!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. --&gt;<br>    <br>    &lt;!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an <br>         encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element. <br>         Then uncomment the keyStore element. --&gt;<br>    &lt;!--<br>    &lt;keyStore password=&quot;&quot;/&gt; <br>    --&gt;<br>    <br>    &lt;!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the<br>        basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password, <br>        generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element. <br>        Then uncomment the user element. --&gt;<br>    &lt;basicRegistry id=&quot;basic&quot; realm=&quot;BasicRealm&quot;&gt; <br>        &lt;!-- &lt;user name=&quot;yourUserName&quot; password=&quot;&quot; /&gt;  --&gt; <br>    &lt;/basicRegistry&gt;<br>    <br>    &lt;!-- To access this server from a remote client add a host attribute to the following element, e.g. host=&quot;*&quot; --&gt;<br>    &lt;httpEndpoint id=&quot;defaultHttpEndpoint&quot;<br>                  httpPort=&quot;9080&quot;<br>                  httpsPort=&quot;9443&quot; /&gt;<br>                  <br>    &lt;!-- Automatically expand WAR files and EAR files --&gt;<br>    &lt;applicationManager autoExpand=&quot;true&quot;/&gt;</pre><pre>&lt;/server&gt;</pre><p>To undeploy and stop the Open Liberty server, execute the following command .</p><pre>mvn liberty:undeploy <br>mvn liberty:stop</pre><p>You can also configure the installDirectory property to use the location of your local Open Liberty server.</p><pre>&lt;configuration&gt;<br>     &lt;installDirectory&gt;D:/appsvr/wlp&lt;/installDirectory&gt;<br>     ...<br>&lt;/configuration&gt;</pre><p>The liberty-maven-plugin does not support to deploy applications to a running server, see <a href="https://github.com/OpenLiberty/ci.maven/issues/16">OpenLiberty/ci.maven#16</a> for details.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dac4529f48c6" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/deploying-jakarta-ee-9-applications-to-open-liberty-dac4529f48c6">Deploying Jakarta EE 9 applications to Open Liberty</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>

  </article>

  

</div>

  </div>

  <!-- Footer -->

  
<footer class="fixed-bottom">
  <div class="container mt-0">
    &copy; Copyright 2021 Hantsy  Bai.
    <span class="mr-auto"></span>
    Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.

    
    

  </div>
</footer>



</body>

<!-- Bootsrap & MDB scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.4.4/umd/popper.min.js" integrity="sha512-eUQ9hGdLjBjY3F41CScH3UX+4JDSI9zXeroz7hJ+RteoCaY+GP/LDoM8AO+Pt+DRFw3nXqsjh9Zsts8hnYv8/A==" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha512-M5KW3ztuIICmVIhjSqXe01oV2bpe248gOxqmlcYrEzAvws7Pw3z6BK0iGbrwvdrUQUhi3eXgtxp5I8PDo9YfjQ==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/js/mdb.min.js" integrity="sha512-Mug9KHKmroQFMLm93zGrjhibM2z2Obg9l6qFG2qKjXEXkMp/VDkI4uju9m4QKPjWSwQ6O2qzZEnJDEeCw0Blcw==" crossorigin="anonymous"></script>


<!-- Mansory & imagesLoaded -->
<script defer src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<script defer src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js"></script>
<script defer src="/assets/js/mansory.js" type="text/javascript"></script>





<!-- Load Common JS -->
<script src="/assets/js/common.js"></script>


</html>
